<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();

    $form->get('memberPassword')->setAttributes([
        'placeholder' => $this->translate('登录密码')
    ]);
    $form->get('memberComPassword')->setAttributes([
        'placeholder' => $this->translate('确认密码')
    ]);
    ?>
    <?php echo $this->form()->openTag($form); ?>
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right">
            <a href="<?php echo $this->url('self-location', ['action' => 'memberList']);?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?php echo $this->translate('返回核销人员列表'); ?></a>
            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('修改登录密码'); ?></button>
            <?php echo $this->HelpUrl('locationMember'); ?>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><?php echo $this->translate('修改核销人员登录密码'); ?></h3>
                    </div>

                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('登录账号'); ?></label>
                            <div class="col-sm-6">
                                <p class="form-control-static"><?php echo $this->escapeHtml($this->member->getMemberAccount()); ?></p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('登录密码'); ?><span class="must_add_value">*</span></label>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('memberPassword')); ?>
                                <?php echo $this->formElementErrors($form->get('memberPassword'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('确认密码'); ?><span class="must_add_value">*</span></label>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('memberComPassword')); ?>
                                <?php echo $this->formElementErrors($form->get('memberComPassword'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </section>
    <?php echo $this->form()->closeTag(); ?>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                memberPassword: {
                    required: true
                },
                memberComPassword: {
                    required: true,
                    equalTo: "#memberPassword"
                }
            },
            messages: {
                memberPassword: {
                    required: "<?php echo $this->translate('请输入登录密码'); ?>"
                },
                memberComPassword: {
                    required: "<?php echo $this->translate('请输入确认密码'); ?>",
                    equalTo: "<?php echo $this->translate('两次输入的密码不一致'); ?>"
                }
            }
        });
    });
</script>